package org.davidtrevien.com.imput.omi.panels.top.menu;

import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JToggleButton;

import layout.TableLayout;

@SuppressWarnings("serial")
public class MenuView
extends JPanel {

	protected JToggleButton planningToggle;
	protected JToggleButton imputationToggle;
	protected JToggleButton holidayToggle;
	protected JToggleButton osToggle;
	protected JToggleButton paramToggle;
	
	protected ButtonGroup group;
	
	public MenuView() {
		initComponent();
	}

	private void initComponent() {
		double size[][] = new double[][] {
				{TableLayout.FILL, 
					100, 
					100, 
					100, 
					100, 
					100, 
				TableLayout.FILL},
				{TableLayout.FILL}
		};
		TableLayout layout = new TableLayout(size);
		
		setLayout(layout);
		
		this.group = new ButtonGroup();
		
		this.planningToggle = new JToggleButton("Planning");
		this.imputationToggle = new JToggleButton("Imputations");
		this.holidayToggle = new JToggleButton("Vacances");
		this.osToggle = new JToggleButton("OS");
		this.paramToggle = new JToggleButton("Paramètres");
		
		this.group.add(this.planningToggle);
		this.group.add(this.imputationToggle);
		this.group.add(this.holidayToggle);
		this.group.add(this.osToggle);
		this.group.add(this.paramToggle);
		
		add(this.planningToggle, "1,0");
		add(this.imputationToggle, "2,0");
		add(this.holidayToggle, "3,0");
		add(this.osToggle, "4,0");
		add(this.paramToggle, "5,0");
		
		this.planningToggle.setName("planning");
		this.imputationToggle.setName("imputation");
		this.holidayToggle.setName("holiday");
		this.osToggle.setName("os");
		this.paramToggle.setName("param");
	}
}
